﻿Imports System.IO

Public Class ctrTruyXuat

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        frmMain.TabControl1.TabPages.Remove(frmMain.TabControl1.SelectedTab)
    End Sub

    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim dlg As FolderBrowserDialog = New FolderBrowserDialog()
        If (dlg.ShowDialog() = DialogResult.OK) Then
            txtLink.Text = dlg.SelectedPath()
        End If
    End Sub

    Private Sub ctrTruyXuat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        cmbFileType.SelectedText = "Excel"
    End Sub

    Private Sub btnDSNV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDSNV.Click
        Dim f As FileInfo = New FileInfo("D:\excel\NHANVIEN.xls")
        f.CopyTo(txtLink.Text + "\NHANVIEN.xls")
        MessageBox.Show("Xuất file excel (Danh sách nhân viên) thành công!!!")
    End Sub

    Private Sub btnDSHD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDSHD.Click
        Dim f As FileInfo = New FileInfo("D:\excel\HOADON.xls")
        f.CopyTo(txtLink.Text + "\HOADON.xls")
        MessageBox.Show("Xuất file excel (Danh sách hóa đơn) thành công!!!")
    End Sub
End Class
